<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>有奖答题平台</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link rel="stylesheet" href="/lib/mobile/css/common.css"/>
    <link rel="stylesheet" href="/lib/mobile/css/knowledge.css"/>
</head>
<body style="background-color: #f1f2f4;">
<div class="main" id="main">

</div>
<ul class="bottom_menu">
    <li  id="indexsy"><a href="javascript:void(0);">首页</a></li>
    <!--<li>|</li>-->
    <li  id="hdrule"><a href="javascript:void(0);">活动规则</a></li>
    <!--<li  id="point_rule"><a href="javascript:void(0);">积分规则</a></li>-->
    <!--<li>|</li>-->
    <!--<li id="prize_rule"><a href="javascript:void(0);">抽奖规则</a></li>-->
    <!--<li>|</li>-->
    <li id="center"><a href="javascript:void(0);">个人中心</a></li>
</ul>
<!-- 依赖库 手机调试的js引用顺序如下 -->
<script src="/lib/mobile/js/zepto.js"></script>
<script src="/lib/mobile/js/plugins/fastclick.js"></script>
<script src="/lib/mobile/js/bui.js"></script>
<script src="/lib/mobile/js/common.js?0000    "></script>

<script>
    bui.ready(function () {
        // 这里写业务及控件初始化
        var storage = bui.storage();
        bui.btn({id: ".bui-page", handle: ".bui-btn"}).load();
        var pageview = {};
        pageview.init = function () {
            // 验证码示例
            var uid=storage.get("uid");
            //我的积分
            getZslbList();
        }
        pageview.init();
    })
    function getZslbList() {
        //执行登录操作
        var loginAjax = bui.ajax({
            url: BASE_URL+"mobile/getHdmcList",
            // 可选参数
            data: {},
            method: "POST"
        });
        loginAjax.then(function(res) {
            if(res.code == 0){
                var user = res.data.data;
                // console.log(user)
                var html=''
                for(var i=0;i<user.length;i++){
                    html=html+"<div class=\"main_title\">\n" +
                        "        <div class=\"title_left\">"+user[i].hdmc+"</div>\n" +
                        "    </div>\n" ;
                    var list=user[i].list;
                    for(var j=0;j<list.length;j++){
                        html=html+ "    <ul class=\"knowledge_list\">\n" +
                            "        <li><a href=\""+BASE_URL+"mobile/hdrule_details?id="+list[j].id+"\"><p>"+list[j].hdmc+"</p><p>"+list[j].cjsj+"</p></a></li>\n" +
                            "    </ul>";
                    }
                }
                $("#main").html(html);
            }else{
                bui.alert(res.msg);
            }
        },function(res) {
            bui.alert("请求异常");
        })
    }
</script>
</body>
</html>